package com.njwb.controller;

import com.njwb.pojo.Dept;

import org.springframework.web.bind.annotation.*;

@RestController
public class DeptController {
    @RequestMapping(value = "dept/dept",method = RequestMethod.POST)
    @PostMapping("page/dept")
    public String add(Dept dept){
        System.out.println(dept);
        return "add success ~";
    }
    @DeleteMapping("page/dept/{deptNo}")
    public String del(@PathVariable("deptNo") Integer deptNo){
        System.out.println(deptNo);
        return "delete success ~";
    }

    @GetMapping("page/dept/deptByNo/{deptNo}")
    public String delByNo(@PathVariable("deptNo") Integer deptNo){
        System.out.println(deptNo);
        return "delete success ~";
    }
    @PutMapping("page/dept")
    public String update(Dept dept){
        System.out.println(dept);
        return "update success ~";
    }
    @GetMapping("page/dept/{deptNo}")
    public String getByNo(@PathVariable("deptNo") Integer deptNo){
        System.out.println(deptNo);
        return "get success ~";
    }
}
